package com.zhengshang.manage.service.impl;

import java.util.List;
import com.zhengshang.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhengshang.manage.mapper.PlatformRebateMapper;
import com.zhengshang.manage.domain.PlatformRebate;
import com.zhengshang.manage.service.IPlatformRebateService;

/**
 * 平台返佣Service业务层处理
 * 
 * @author zhengshang
 * @date 2021-03-18
 */
@Service
public class PlatformRebateServiceImpl implements IPlatformRebateService 
{
    @Autowired
    private PlatformRebateMapper platformRebateMapper;

    /**
     * 查询平台返佣
     * 
     * @param id 平台返佣ID
     * @return 平台返佣
     */
    @Override
    public PlatformRebate selectPlatformRebateById(Long id)
    {
        return platformRebateMapper.selectPlatformRebateById(id);
    }

    /**
     * 查询平台返佣列表
     * 
     * @param platformRebate 平台返佣
     * @return 平台返佣
     */
    @Override
    public List<PlatformRebate> selectPlatformRebateList(PlatformRebate platformRebate)
    {
        return platformRebateMapper.selectPlatformRebateList(platformRebate);
    }

    @Override
    public int queryDateCount(PlatformRebate platformRebate) {
        return platformRebateMapper.queryDateCount(platformRebate);
    }

    /**
     * 新增平台返佣
     * 
     * @param platformRebate 平台返佣
     * @return 结果
     */
    @Override
    public int insertPlatformRebate(PlatformRebate platformRebate)
    {
        platformRebate.setCreateTime(DateUtils.getNowDate());
        return platformRebateMapper.insertPlatformRebate(platformRebate);
    }

    /**
     * 修改平台返佣
     * 
     * @param platformRebate 平台返佣
     * @return 结果
     */
    @Override
    public int updatePlatformRebate(PlatformRebate platformRebate)
    {
        platformRebate.setUpdateTime(DateUtils.getNowDate());
        return platformRebateMapper.updatePlatformRebate(platformRebate);
    }

    /**
     * 批量删除平台返佣
     * 
     * @param ids 需要删除的平台返佣ID
     * @return 结果
     */
    @Override
    public int deletePlatformRebateByIds(Long[] ids)
    {
        return platformRebateMapper.deletePlatformRebateByIds(ids);
    }

    /**
     * 删除平台返佣信息
     * 
     * @param id 平台返佣ID
     * @return 结果
     */
    @Override
    public int deletePlatformRebateById(Long id)
    {
        return platformRebateMapper.deletePlatformRebateById(id);
    }
}
